package org.dx.oho.entity;

import java.util.List;
import java.util.Objects;

/**
 * create by duanx 2020/11/9
 *@description： 产品信息表
 *@classname: Product
 *@author: duanx
 *@date: 2020/11/9 17:10
 **/
public class Product extends BaseEntity {
    /**
     * 产品ID
     */
    private Long productId;
    /**
     * 产品名称
     */
    private String productName;
    /**
     * 产品描述
     */
    private String productDesc;
    /**
     * 缩略图地址
     */
    private String imgAddr;
    /**
     * 正常价格
     */
    private String normalPrice;
    /**
     * 展示价格
     */
    private String promotionPrice;
    /**
     * 优先级
     */
    private Integer priority;
    /**
     * 折扣
     */
    private Integer point;
    /**
     * 是否上架
     */
    private String enableStatus;
    /**
     * 产品类别
     */
    private ProductCategory productCategory;
    /**
     * 所属商店
     */
    private Shop shop;
    /**
     * 图片集合
     */
    private List<ProductImg> productImgs;
    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductDesc() {
        return productDesc;
    }

    public void setProductDesc(String productDesc) {
        this.productDesc = productDesc;
    }

    public String getImgAddr() {
        return imgAddr;
    }

    public void setImgAddr(String imgAddr) {
        this.imgAddr = imgAddr;
    }

    public String getNormalPrice() {
        return normalPrice;
    }

    public void setNormalPrice(String normalPrice) {
        this.normalPrice = normalPrice;
    }

    public String getPromotionPrice() {
        return promotionPrice;
    }

    public void setPromotionPrice(String promotionPrice) {
        this.promotionPrice = promotionPrice;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    public Integer getPoint() {
        return point;
    }

    public void setPoint(Integer point) {
        this.point = point;
    }

    public String getEnableStatus() {
        return enableStatus;
    }

    public void setEnableStatus(String enableStatus) {
        this.enableStatus = enableStatus;
    }

    public ProductCategory getProductCategory() {
        return productCategory;
    }

    public void setProductCategory(ProductCategory productCategory) {
        this.productCategory = productCategory;
    }

    public Shop getShop() {
        return shop;
    }

    public void setShop(Shop shop) {
        this.shop = shop;
    }

    public List<ProductImg> getProductImgs() {
        return productImgs;
    }

    public void setProductImgs(List<ProductImg> productImgs) {
        this.productImgs = productImgs;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Product product = (Product) o;
        return Objects.equals(productId, product.productId) &&
                Objects.equals(productName, product.productName) &&
                Objects.equals(productDesc, product.productDesc) &&
                Objects.equals(imgAddr, product.imgAddr) &&
                Objects.equals(normalPrice, product.normalPrice) &&
                Objects.equals(promotionPrice, product.promotionPrice) &&
                Objects.equals(priority, product.priority) &&
                Objects.equals(point, product.point) &&
                Objects.equals(enableStatus, product.enableStatus) &&
                Objects.equals(productCategory, product.productCategory) &&
                Objects.equals(shop, product.shop) &&
                Objects.equals(productImgs, product.productImgs);
    }

    @Override
    public int hashCode() {
        return Objects.hash(productId, productName, productDesc, imgAddr, normalPrice, promotionPrice, priority, point, enableStatus, productCategory, shop, productImgs);
    }

    @Override
    public String toString() {
        return  "Product{" +
                "productId=" + productId +
                ", productName='" + productName + '\'' +
                ", productDesc='" + productDesc + '\'' +
                ", imgAddr='" + imgAddr + '\'' +
                ", normalPrice='" + normalPrice + '\'' +
                ", promotionPrice='" + promotionPrice + '\'' +
                ", priority=" + priority +
                ", point=" + point +
                ", enableStatus='" + enableStatus + '\'' +
                ", productCategory=" + productCategory +
                ", shop=" + shop +
                ", productImgs=" + productImgs +
                '}';
    }
}
